#ifndef ABSTRACTCONTAINER_H
#define ABSTRACTCONTAINER_H

#include "abstractstorage.h"

#include <QList>

class QXmlStreamWriter;
class QXmlStreamReader;

class AbstractContainer : private QList<AbstractStorage*>
{
public:
    AbstractContainer();
    AbstractContainer(const QString &name);
    AbstractContainer(AbstractContainer &container);
    AbstractContainer(AbstractContainer *container);
    virtual ~AbstractContainer();

    void setName(const QString & name) { m_name = name; }
    QString name() { return m_name; }

    virtual void readFromXml(QXmlStreamReader* pXml);
    virtual void writeToXml(QXmlStreamWriter* pXml);

    int size();
    void clear();
    void append(AbstractStorage* t);
    void removeAt(int i);
    AbstractStorage* appendStorage(const QString &name);
    AbstractStorage *at(int i);

private:
    QString m_name;

};

#endif // ABSTRACTCONTAINER_H
